import { http } from "@/utils/http";

// 获取账号列表
export const accountList = (
  pageIndex: number | string,
  pageSize: number
): Promise<any> => {
  return http.request("get", "/user/page", {
    params: {
      pageIndex,
      pageSize
    }
  });
};

// 新增账号
export const incrementAccountItem = (config: any): Promise<any> => {
  return http.request("post", "/user/add", config);
};

// 编辑账号
export const modifyAccount = (config: any): Promise<any> => {
  return http.request("post", "/user/add", config);
};

// 删除账号
export const removeAccountItem = (id: string | number): Promise<any> => {
  return http.request("post", "/user/add", {
    params: {
      id
    }
  });
};

// 获取账号详细信息
export const accountDetail = (id: number | string): Promise<any> => {
  return http.request("get", "", {
    params: {
      id
    }
  });
};
